import config from '../../utils/config';

export default function profitAndLossAPI(api) {
  return {
    //获取产品指定时间范围期初期末时间
    findProductTime1: {
      main: (query) => api.get(`${config.interfaces.type3}portfolio/getBeginEndTime/`, query),
      barra: (query) => api.get(`${config.interfaces.type5}maat-workstation/barraProduct/getBeginEndTime`, query),
    },
    findProductTime: (query) => api.get(`${config.interfaces.type3}portfolio/getBeginEndTime/`, query),
    //获取明细
    getTableData: (query) => api.post(`${config.interfaces.type3}portfoliopnl/ProfitLossDetails/`, query),
    //获取时点盈亏数据
    getPnlData: (query) => api.post(`${config.interfaces.type3}portfoliopnl/pnl/`, query),
    //获取区间维度信息
    getEchartDate1: (query) => api.post(`${config.interfaces.type3}portfoliopnl/intervalCount/`, query),
    //获取资产维度统计柱状图
    getEchartDate2: (query) => api.post(`${config.interfaces.type3}portfoliopnl/majorAssetCount/`, query),
    // 获取资产维度统计排名
    getEchartInfo: (query) => api.post(`${config.interfaces.type3}portfoliopnl/majorAssetTop/`, query),
  };
}
